(transient-mark-mode t)
(tool-bar-mode nil)
(menu-bar-mode nil)
(display-time)
(scroll-bar-mode nil)

(global-set-key [f2] 'comment-region)
(global-set-key [f3] 'uncomment-region)
(global-set-key [f4] 'goto-line)
(global-set-key [f5] 'indent-region)
(global-set-key "\C-l" 'previous-line)
(global-set-key "\C-w" 'backward-kill-word)
(global-set-key "\C-j" 'exit-recursive-edit)

(global-set-key "\C-x\C-k" 'kill-region)
(global-set-key "\C-c\C-k" 'kill-region)
(global-set-key "\M-r" 'search-forward-regexp)

(global-set-key "\C-x\C-m" 'execute-extended-command)
(global-set-key "\C-c\C-m" 'execute-extended-command)
(global-set-key "\C-h" 'backward-delete-char-untabify)
(defalias 'qrr 'query-replace-regexp)



(setq backup-inhibited t)
;disable auto save
(setq auto-save-default nil)

;;some custom functions, stolen for internet
(defun geosoft-forward-word ()
   ;; Move one word forward. Leave the pointer at start of word
   ;; instead of emacs default end of word. Treat _ as part of word
   (interactive)
   (forward-char 1)
   (backward-word 1)
   (forward-word 2)
   (backward-word 1)
   (backward-char 1)
   (cond ((looking-at "_") (forward-char 1) (geosoft-forward-word))
         (t (forward-char 1)))) 
(defun geosoft-backward-word ()
   ;; Move one word backward. Leave the pointer at start of word
   ;; Treat _ as part of word
   (interactive)
   (backward-word 1)
   (backward-char 1)
   (cond ((looking-at "_") (geosoft-backward-word))
         (t (forward-char 1)))) 

(global-set-key [C-right] 'geosoft-forward-word)
(global-set-key [C-left] 'geosoft-backward-word)

(defun visit-ruby-tag()
  (interactive)
  (find-tag(current-word)))
(global-set-key "\M-." 'visit-ruby-tag)

(global-set-key "\M--" 'shell-command-on-region)

;; (define-key text-mode-map [tab] (lambda
;; 				  () (interactive) (insert "  ")))

(define-key text-mode-map [tab] (lambda
				  () (interactive) (insert "  ")))

